#include <atomic>
#include <bits/stdc++.h>
using namespace std;

class Solution {
public:
    bool canJump(vector<int>& nums) {
        int n = nums.size();
        if(n<2) return true;

        int cover = 0;
        for(int i=0; i<=cover; ++i){
            if(i+nums[i] > cover) cover = i+nums[i];
            if(cover>=n-1) return true;
        }
        return false;
    }
};